
#FF
jpt=all

grid=$1
tof=$2
charge=$3

dd0=$(pwd)

#for ii in $(echo 10d 10e 11a 10-d-e 10hCEN{0,1,2,3,4,5})
#for ii in $(echo 10-d-e)

#FF
for ii in $(echo histRecInclusiveTPC  histRecIDFFHis)
do
    echo $ii
    dir=newTCFr250_cmpEta_$charge\_$tof\_GrID$grid/$ii
#\_jpt$jpt
    mkdir -p $dir
    cd $dir

    for jj in $(seq 0 3)
    do 
        pwd
        #ln -s $dd0/finish/*$charge*$ii*ETA$jj*co*/$tof\Sys$grid/out*.root 

#FF        
        #ln -s ../../newTCFr250_finish/*$charge*$ii*ETA$jj*JPT$jpt*co*/$tof\Sys$grid/out*.root 
        ln -s ../../newTCFr250_finish/*$charge*$ii*ETA$jj*JPT$jpt*co*/Sys$grid/out*.root 


        file=$(find out*.root)
        echo $file
        ln -s $(readlink -f $file) ETA$jj\_$ii\.root
        unlink $file

#        ln -s ../../$ii*ETA$jj*/fromPT*.root 
#        file=$(find fromPT*.root)
#        echo $file
#        ln -s $(readlink -f $file) ETA$jj$file
#        unlink $file

    done

#    ln -s ../../$ii*ETAALL*/fromPT*.root 
#    file=$(find fromPT*.root)
#    echo $file
#    ln -s $(readlink -f $file) ETAALL$file
#    unlink $file

    ln -s /u/xlu/.task/2dbetabloch/plotcode/drawFractionRatio.C 
    cp $dd0/DATAdodrawcmpEta.sh do.sh
    cd $dd0
done
